// 导入需要的config和request
import confing from '../config/config.js';
import request from '../util/request.js';
// 申明请求对象
const routeProcessRequest = {
    // dict请求的基本url
    BASE_URL :  confing.PRO_URL + "/routeProcess",
    //全部分页请求
    get(page = 1,limit = 10,routeId,callback){
        // url
        let url = this.BASE_URL + "/get?page=" + page + "&limit=" + limit+ "&routeId="+routeId;
        // 发送请求
        request.get(url,callback);
    },
    //新增工艺组成
    save(proRouteProcess,callback){
       let url=this.BASE_URL+'/save';
       request.post(url,proRouteProcess,callback);
    },
    deleteRouteProcess(recordId,callback){
        request.delete(this.BASE_URL+"/deleteRouteProcess?recordId="+recordId,callback);
    },
    updateRouteProcess(proRouteProcess,callback){
        let url=this.BASE_URL+'/update';
        request.post(url,proRouteProcess,callback);   
    }

}

// 将dictRequest暴漏出去
export default routeProcessRequest;